package com.study.springboot2.controller;

import com.study.springboot2.properties.HelloServiceProperties;
import com.study.springboot2.service.HelloService;
import com.study.springboot2.service.OrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class ConfigurationPropertiesController {

    @Autowired
    private HelloServiceProperties helloServiceProperties;

    @Autowired
    private HelloService helloService;

    @Autowired
    private OrderService orderService;

    @RequestMapping("/getObjectProperties")
    public Object getObjectProperties () {
        System.out.println(helloServiceProperties.toString());
        return null; //myConfigTest.getProperties();
    }

    @RequestMapping("/hello")
    public String hello() {

        orderService.order();
        helloService.hello();
        return "hello world.";
    }
}